package com.rc.saas.mini.client;

import com.rc.saas.mini.common.base.TResponse;
import com.rc.saas.mini.vo.cec.StdRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

/**
 * 打印机服务
 * @author wangzhengwei
 * @create 2021/4/23
 */
@Component
@FeignClient(name = PrinterClient1.SERVICE_NAME, path = PrinterClient1.SERVICE_PATH)
public interface PrinterClient1 {
    ////项目名称
    String SERVICE_NAME = "jinzhuang-saas-printer";
    //项目部署的路径
    String SERVICE_PATH = "/jinzhuang-saas-printer";

    /**
     * 测试地十：http://localhost:8181/client/test/3
     * 路径跟入参和server端的controller方法一样
     * @return
     */
    @GetMapping("/micro/test/{id}")
    @ResponseBody
    String test(@PathVariable(value = "id") Long id);

    /**
     * 发送打印指令
     * RequestMapping路径是服务提供方的路径
     * @param tRequest
     * @return
     */
    @RequestMapping(value = "/print/query_start_print", method = RequestMethod.POST)
    TResponse query_start_print(@RequestBody StdRequest tRequest);

    /**
     * 重置打印小票次数
     * RequestMapping路径是服务提供方的路径
     * @param tRequest
     * @return
     */
    @RequestMapping(value = "/print/query_reset_print", method = RequestMethod.POST)
    TResponse query_reset_print(@RequestBody StdRequest tRequest);
}
